package com.qianfeng.wuyang.himalaya.adapter.recommendadapter;

import android.app.Application;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.qianfeng.wuyang.himalaya.R;
import com.qianfeng.wuyang.himalaya.activity.MainActivity;
import com.qianfeng.wuyang.himalaya.bean.recommendbean.Recomend_progremeItem;

import java.util.List;

/**
 * Created by ShenHao on 2016/12/13.
 */

public class Adapter_Guess2Pro extends RecyclerView.Adapter<Adapter_Guess2Pro.MyViewHolder>{

    private Context context;
    private List<Recomend_progremeItem> list;
    private MainActivity activity;
    public static final int HEAD_ID=0;
    public static final int RECYCLER_ID=1;

    public Adapter_Guess2Pro(Context context,MainActivity activity) {
        this.context = context;
        this.activity=activity;
        Application application=activity.getApplication();

    }

    @Override
    public int getItemViewType(int position) {
        if (position==0) {
            return HEAD_ID;
        }else{
        return RECYCLER_ID;
        }

    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType==HEAD_ID) {
            return new MyViewHolder(LayoutInflater.from(context).inflate(R.layout.recomend_progremi_tem1,parent,false));
        }else{

        return new MyViewHolder(LayoutInflater.from(context).inflate(R.layout.recomend_progrem_recycler_item,parent,false));
        }
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
        if (position==0) {

        }
    }

    @Override
    public int getItemCount() {
        return 0;
    }

    public class MyViewHolder extends RecyclerView.ViewHolder{

        TextView text_pageSize;
        TextView text_proTitle,text_proPlaytimes,text_pro_time,text_pro_comments,text_proDate;
        ImageView image_proCoverSmall;

        public MyViewHolder(View itemView) {
            super(itemView);
            text_pageSize= (TextView) itemView.findViewById(R.id.text_pro_pageSize);

            text_pro_comments= (TextView) itemView.findViewById(R.id.pro_comments);
            text_pro_time= (TextView) itemView.findViewById(R.id.pro_time);
            text_proPlaytimes= (TextView) itemView.findViewById(R.id.pro_playtimes);
            text_proTitle= (TextView) itemView.findViewById(R.id.recomend_progrem_recycler_title);
            image_proCoverSmall= (ImageView) itemView.findViewById(R.id.recomend_progrem_recycler_coverSmall);

            text_proDate= (TextView) itemView.findViewById(R.id.recomend_progrem_date);

        }
    }
}
